package org.shopen.ai.puremvc.model.settings
{
	import mx.collections.ArrayCollection;

	public class AutoSettings implements ISettings
	{
		public var algorithms : ArrayCollection = new ArrayCollection();
		public var repeatCount : uint = 1;
		
		public function AutoSettings(algos : ArrayCollection, repeatCount : uint = 1)
		{
			this.algorithms = algos;
			this.repeatCount = repeatCount;
		}

		public function isValid():Boolean
		{
			var result : Boolean = false;
			if (invalidFields == null)
			{
				result = true;
			}
			else
			{
				result = invalidFields.length == 0;
			}
			return result;
		}
		
		public function get invalidFields():ArrayCollection
		{
			var result : ArrayCollection = new ArrayCollection();
			if (algorithms == null || algorithms.length == 0)
			{
				result.addItem("Algorithms");
			}
			return result;
		}
		
	}
}